import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Screen from './views/screen.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      //智安街区
      path: '/:userid',
      // name: 'screen',
      redirect:"/screen/1/:userid",
      // component: Screen
    },
    {
      //平安校园
      path: '/xy/:id',
      // name: 'screen',
      redirect:"/screen/2/:userid",
      // component: Screen
    },
    {
      path: '/screen/:id/:userid',
      name: 'screen',
      component: Screen
    },
    {
      path: '/home/:index',
      name: 'home',
      component: Home
    },
    {
      path: '/guide',
      name: 'guide',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/Guide.vue')
    },
    {
      path: '/login',
      name: 'login',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/Login.vue')
    }
  ]
})
